package com.exercise.DesignPattern.StructuralPatterns.ProxyPattern;

// 代理类
public class Proxy implements Subject{

    private RealSubject realSubject;

    @Override
    public void request() {
        if (realSubject == null) {
            realSubject = new RealSubject();
        }
        realSubject.request();  //对代理主题的访问
    }
}
